package com.asifrc.tw101;

import java.util.Collections;

/**
 * Created by asifrc on 2/11/14.
 */
public class IsoscelesTriangle extends MultiLine {

    public IsoscelesTriangle(int n) {
        super(n);
    }

    @Override
    void draw(int n) {
        for (int i = 0; i < n; i++) {
            int points = (i * 2) + 1;
            int padding = n - (i + 1);
            Line line = new Line(points);
            line.pad(padding);
            addLine(line);
        }
    }

    public void invert() {
        Collections.reverse(getLines());
    }
}
